package main

import (
	"context"
	"github.com/spf13/cobra"
	client "hello-kratos/kratos-client/cmd"
	server "hello-kratos/kratos-server/cmd"
	"os"
	"os/signal"
)

func main() {
	cmd := cobra.Command{Use: "hello-kratos"}
	cmd.AddCommand(server.Command())
	cmd.AddCommand(client.Command())

	ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
	defer cancel()
	if err := cmd.ExecuteContext(ctx); err != nil {
		panic(err)
	}
}
